feat: add worktree management commands and per-worktree trunks#1224
Draft
ed-irl wants to merge 1 commit into
Draft
feat: add worktree management commands and per-worktree trunks#1224ed-irl wants to merge 1 commit into
ed-irl wants to merge 1 commit into
Conversation
Collaborator
Author
|
This change is part of the following stack:
Change managed by git-spice. |
63df853 to
8a8c3a0
Compare
2f2d7a9 to
673dc16
Compare
This was referenced Jun 2, 2026
Draft
673dc16 to
3c58177
Compare
a90b3d9 to
6582823
Compare
3c58177 to
75e05c0
Compare
6582823 to
2ed2e4c
Compare
e46ecf6 to
658c245
Compare
19612c8 to
3236937
Compare
658c245 to
9b32be2
Compare
3236937 to
574274d
Compare
9b32be2 to
b8a0e76
Compare
574274d to
1f36ef6
Compare
b8a0e76 to
9bb9a70
Compare
1f36ef6 to
6ba0470
Compare
00e9ec6 to
ed5caa4
Compare
727d9c9 to
f6e3920
Compare
62a5aa0 to
204ded0
Compare
8b743fa to
52eb198
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
gs worktree createandgs worktree list, plus worktree-aware filtering across the stack.Commands
gs worktree create <path>(aliaswt c): creates a Git worktree. By default it sets up a per-worktree trunk — a local branch (named after the worktree dir, or--trunk) that tracks the same remote ref as the canonical trunk, so sync/restack in different worktrees never contend on one shared trunk checkout.--no-trunkkeeps the legacy detached-HEAD behavior;-b/--branchalso creates a tracked branch stacked on the worktree trunk.gs worktree list(aliaswt ls): lists worktrees with their checked-out branch and stack.Per-worktree trunks
worktree-trunksstate key registers worktree-trunk branches. The key is additive and optional, so older repos/binaries are unaffected.Store.IsTrunk/TrunkFor/WorktreeTrunkstreat registered branches as trunk-equivalents: valid stack roots that may not themselves be tracked or deleted.BranchGraphstops traversals at any trunk-equivalent, and gainsStacksInWorktreeto collect full stacks touching a worktree.syncpulls the canonical remote trunk into the worktree's local trunk; the split is a no-op in the primary worktree.Worktree filtering
-w/--worktreeonlog shortandrepo restackscopes operations to stacks checked out in the current worktree.repo restackgains aWorktreeFilterandSkipCheckouton the restack handler.Tests
worktree_create,worktree_list,log_short_worktree_filter,repo_restack_worktree_filter, and worktree-trunk branch create/restack regressions.